package com.newgrand.controller;

import com.newgrand.model.I8ReturnModel;
import com.newgrand.model.StatusMsg;
import com.newgrand.service.impl.SupplyService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: zhanglixin
 * @Data: 2022/11/19 12:41
 * @Description: TODO
 */
@Slf4j
@Api(tags = "手工同步用")
@RestController
@RequestMapping("/Supply")
public class SupplyController {
    @Autowired
    private SupplyService supplyService;
    @RequestMapping(value = "/syncSupply", method = RequestMethod.GET)
    public @ResponseBody
    Object SyncSupply() throws Exception {
        try{
            supplyService.SyncData();
            return null;
        }catch (Exception ex){
        }
        return null;
    }

    @RequestMapping(value = "/message", method = RequestMethod.POST)
    public @ResponseBody
    StatusMsg Message(@RequestBody String data) throws Exception {
        return supplyService.Message(data);
    }


    /**
     * 删除重复的供应商
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/deleteSupply", method = RequestMethod.GET)
    public @ResponseBody
    Object deleteSupply() throws Exception {
        try{
            supplyService.deleteData();
            return null;
        }catch (Exception ex){
        }
        return null;
    }


}
